import Vue from 'vue'
import { USER_INFO} from "@/store/mutation-types"
const getters = {
  device: state => state.app.device,
  theme: state => state.app.theme,
  color: state => state.app.color,
  token: state => state.user.token,
  avatar: state => {state.user.avatar = Vue.ls.get(USER_INFO).avatar; return state.user.avatar},
  username: state => state.user.username,
  nickname: state => {state.user.realname = Vue.ls.get(USER_INFO).realname; return state.user.realname},
  welcome: state => state.user.welcome,
  permissionList: state => state.user.permissionList,
  userInfo: state => {state.user.info = Vue.ls.get(USER_INFO); return state.user.info},
  addRouters: state => state.permission.addRouters,
  deviceid: state => {
    window.localStorage.getItem('deviceid')
  },
   //当前推送值
   getLocalData(state){
      if(state.imMessages){
          state.imMessage=JSON.parse(window.localStorage.getItem('dataJson'));
      }else{
          state.imMessage='';
      }
      return state.imMessage;
  }
}

export default getters